<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
         //封装
         class Stu{
            constructor(name){
                this.name=name
            }
            say(){
                console.log('错了');
            }
         }
        //  let el=new Stu("my")
        //  console.log(ol);
        //  ol.say();
       //继承
       class Man extends Stu{
        constructor(name){
            super(name)
            this.sex="男"
        }
       } 
       let o2=new Man("忘")
       console.log(o2);
       o2.say()
    </script>
</body>
</html>